﻿<UserControl x:Class="SLExtensions.Showcase.PageHtmlConverter"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:slec="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"
    xmlns:sled="clr-namespace:SLExtensions.Data;assembly=SLExtensions.Data"
    xmlns:ext="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:controllers="clr-namespace:SLExtensions.Showcase.Controllers"
    >
    <UserControl.Resources>
        <controllers:PageHtmlConverterController x:Key="controller" />
        <sled:HtmlStripConverter x:Name="stripConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
            <TextBox Grid.ColumnSpan="2" Text="{Binding Html, Mode=TwoWay, Source={StaticResource controller}}"/>
        
        <slec:DockPanel Grid.Row="1">
            <TextBlock Text="HtmlStripConverter" slec:DockPanel.Dock="Top" TextWrapping="Wrap"/>
            <Border BorderBrush="Black">
                <TextBlock Text="{Binding Html, Source={StaticResource controller}, Converter={StaticResource stripConverter}}" TextWrapping="Wrap"/>
            </Border>
        </slec:DockPanel>
        
        <slec:DockPanel Grid.Row="1" Grid.Column="1">
            <TextBlock Text="HtmlInlineConverter from http://blogs.msdn.com/delay/archive/2007/09/10/bringing-a-bit-of-html-to-silverlight-htmltextblock-makes-rich-text-display-easy.aspx" 
                       slec:DockPanel.Dock="Top" TextWrapping="Wrap"/>
            <Border BorderBrush="Black">
                <TextBlock sled:HtmlInlineConverter.Html="{Binding Html, Source={StaticResource controller}}" TextWrapping="Wrap"/>
            </Border>
        </slec:DockPanel>
        <TextBlock />
        <ext:GridSplitter Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
    </Grid>
</UserControl>
